Another way to generate dynamic content is to use Java servlets. Servlets are Java programs that are loaded into an application server, such as a WebSphere Application Server. They do the same thing as CGI scripts, but they reside in server memory so they are more responsive to user requests.
JSPs provide a way to combine the worlds of HTML and Java servlet programming. JSPs are text files that look very much like HTML pages. The HTML is enhanced with new tags that specify the programming of a servlet to control the generation of dynamic content.
If the user has requested information that’s in static pages that reside on the http server, the response will be an HTML version of the stored page. For dynamic responses, a call will go from the http server to WebSphere, or other application server, where JSPs and servlets are managed. The application server can be configured to preload Java servlets so they can quickly respond to even the first user’s request.
JSP files only need to be compiled and loaded once. At some point in the future, if a newer version of the JSP becomes available, the application server will compile the newer one and load its version of the servlet.
Click FORWARD to continue.